/**
 * @author Daniel
 */

/**
 * 对line的补充扩展
 */
$.extend(Kinetic.Line.prototype, {
	
    /**
     * 渐进渲染，只画整条线中的一节(相邻点之前)，避免draw带来的性能问题
     * add by daniel.xiao
     */
    drawSmallStep: function(x, y) {
    	var context = this.getLayer().getContext();
		this.getPoints().push({x:x, y:y});
        if(this.attrs.dashArray.length > 0) {
            // draw dashed line
            var lastX = this.attrs.points[n - 1].x;
            var lastY = this.attrs.points[n - 1].y;
            this._dashedLine(context, lastX, lastY, x, y, this.attrs.dashArray);
        }
        else {
            // draw normal line
            context.lineTo(x, y);
        }  
        this.stroke(context); 	
    }
});
